/*
  LinPVR - Linux Personal Video Recorder
  Copyright (C) 2006 Kamil Pawlowski <kamilpe@gmail.com>

  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License
  as published by the Free Software Foundation; either version 2
  of the License, or (at your option) any later version.
  
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
  
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
*/
#ifndef _OGG_DEC_H_
#define _OGG_DEC_H_

#include <ogg/ogg.h>
#include <stdio.h>
#include <theora/theora.h>

typedef struct ogg_dec_s {
  FILE *in_file;

  /* ogg */
  ogg_sync_state o_state;

  /* theora */
  int t_serialno;
  yuv_buffer yuv;
  theora_info t_info;
  theora_comment t_comment;
  theora_state t_state;
  ogg_stream_state to_state;
} ogg_dec_t;

int    ogg_dec_open(ogg_dec_t *ogg_dec, const char *ogg_path);
double ogg_dec_length(ogg_dec_t *ogg_dec);
void   ogg_dec_close(ogg_dec_t *ogg_dec);

#endif
